<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS -fno-warn-orphans #-}</span><span>
</span><span id="line-2"></span><span class="hs-comment">-- | TAI and leap-second maps for converting to UTC: most people won't need this module.</span><span>
</span><span id="line-3"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Time.Clock.TAI</span><span>
</span><span id="line-4"></span><span class="hs-special">(</span><span>
</span><span id="line-5"></span><span>    </span><span class="hs-comment">-- TAI arithmetic</span><span>
</span><span id="line-6"></span><span>    </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.AbsoluteTime.html"><span class="hs-identifier">Data.Time.Clock.Internal.AbsoluteTime</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span>    </span><span class="hs-comment">-- leap-second map type</span><span>
</span><span id="line-9"></span><span>    </span><span class="annot"><a href="Data.Time.Clock.TAI.html#LeapSecondMap"><span class="hs-identifier">LeapSecondMap</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span>    </span><span class="hs-comment">-- conversion between UTC and TAI with map</span><span>
</span><span id="line-12"></span><span>    </span><span class="annot"><a href="Data.Time.Clock.TAI.html#utcDayLength"><span class="hs-identifier">utcDayLength</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Clock.TAI.html#utcToTAITime"><span class="hs-identifier">utcToTAITime</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Clock.TAI.html#taiToUTCTime"><span class="hs-identifier">taiToUTCTime</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span>    </span><span class="annot"><a href="Data.Time.Clock.TAI.html#taiClock"><span class="hs-identifier">taiClock</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.AbsoluteTime.html"><span class="hs-identifier">Data.Time.Clock.Internal.AbsoluteTime</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.LocalTime.html"><span class="hs-identifier">Data.Time.LocalTime</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html"><span class="hs-identifier">Data.Time.Calendar.Days</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.SystemTime.html"><span class="hs-identifier">Data.Time.Clock.Internal.SystemTime</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Clock.System.html"><span class="hs-identifier">Data.Time.Clock.System</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Clock.html"><span class="hs-identifier">Data.Time.Clock</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Fixed.html#"><span class="hs-identifier">Data.Fixed</span></a></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679074758"><span id="local-6989586621679074761"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.AbsoluteTime.html#AbsoluteTime"><span class="hs-identifier hs-type">AbsoluteTime</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-27"></span><span>    </span><span id="local-6989586621679074751"><span class="annot"><span class="annottext">show :: AbsoluteTime -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span id="local-6989586621679074749"><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074749"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalTime -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TimeZone -&gt; UTCTime -&gt; LocalTime
</span><a href="Data.Time.LocalTime.Internal.LocalTime.html#utcToLocalTime"><span class="hs-identifier hs-var">utcToLocalTime</span></a></span><span> </span><span class="annot"><span class="annottext">TimeZone
</span><a href="Data.Time.LocalTime.Internal.TimeZone.html#utc"><span class="hs-identifier hs-var">utc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe UTCTime -&gt; UTCTime
forall a. HasCallStack =&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromJust"><span class="hs-identifier hs-var">fromJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LeapSecondMap -&gt; AbsoluteTime -&gt; Maybe UTCTime
</span><a href="Data.Time.Clock.TAI.html#taiToUTCTime"><span class="hs-identifier hs-var">taiToUTCTime</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Int -&gt; LeapSecondMap
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Maybe Int
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074749"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; TAI&quot;</span></span><span> </span><span class="hs-comment">-- ugly, but standard apparently</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-comment">-- | TAI - UTC during this day.</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- No table is provided, as any program compiled with it would become</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- out of date in six months.</span><span>
</span><span id="line-32"></span><span class="hs-keyword">type</span><span> </span><span id="LeapSecondMap"><span class="annot"><a href="Data.Time.Clock.TAI.html#LeapSecondMap"><span class="hs-identifier hs-var">LeapSecondMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="annot"><a href="Data.Time.Clock.TAI.html#utcDayLength"><span class="hs-identifier hs-type">utcDayLength</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Clock.TAI.html#LeapSecondMap"><span class="hs-identifier hs-type">LeapSecondMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.DiffTime.html#DiffTime"><span class="hs-identifier hs-type">DiffTime</span></a></span><span>
</span><span id="line-35"></span><span id="utcDayLength"><span class="annot"><span class="annottext">utcDayLength :: LeapSecondMap -&gt; Day -&gt; Maybe DiffTime
</span><a href="Data.Time.Clock.TAI.html#utcDayLength"><span class="hs-identifier hs-var hs-var">utcDayLength</span></a></span></span><span> </span><span id="local-6989586621679074744"><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074744"><span class="hs-identifier hs-var">lsmap</span></a></span></span><span> </span><span id="local-6989586621679074743"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074743"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-36"></span><span>    </span><span id="local-6989586621679074742"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679074742"><span class="hs-identifier hs-var">i0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074744"><span class="hs-identifier hs-var">lsmap</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074743"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span id="local-6989586621679074741"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679074741"><span class="hs-identifier hs-var">i1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074744"><span class="hs-identifier hs-var">lsmap</span></a></span><span> </span><span class="annot"><span class="annottext">LeapSecondMap -&gt; LeapSecondMap
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#addDays"><span class="hs-identifier hs-var">addDays</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074743"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><span class="annottext">DiffTime -&gt; Maybe DiffTime
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(DiffTime -&gt; Maybe DiffTime) -&gt; DiffTime -&gt; Maybe DiffTime
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; DiffTime
forall a b. (Real a, Fractional b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#realToFrac"><span class="hs-identifier hs-var">realToFrac</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">86400</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679074741"><span class="hs-identifier hs-var">i1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679074742"><span class="hs-identifier hs-var">i0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="annot"><a href="Data.Time.Clock.TAI.html#dayStart"><span class="hs-identifier hs-type">dayStart</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Clock.TAI.html#LeapSecondMap"><span class="hs-identifier hs-type">LeapSecondMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.AbsoluteTime.html#AbsoluteTime"><span class="hs-identifier hs-type">AbsoluteTime</span></a></span><span>
</span><span id="line-41"></span><span id="dayStart"><span class="annot"><span class="annottext">dayStart :: LeapSecondMap -&gt; Day -&gt; Maybe AbsoluteTime
</span><a href="Data.Time.Clock.TAI.html#dayStart"><span class="hs-identifier hs-var hs-var">dayStart</span></a></span></span><span> </span><span id="local-6989586621679074737"><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074737"><span class="hs-identifier hs-var">lsmap</span></a></span></span><span> </span><span id="local-6989586621679074736"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074736"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-42"></span><span>    </span><span id="local-6989586621679074735"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679074735"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074737"><span class="hs-identifier hs-var">lsmap</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074736"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-43"></span><span>    </span><span class="annot"><span class="annottext">AbsoluteTime -&gt; Maybe AbsoluteTime
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(AbsoluteTime -&gt; Maybe AbsoluteTime)
-&gt; AbsoluteTime -&gt; Maybe AbsoluteTime
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DiffTime -&gt; AbsoluteTime -&gt; AbsoluteTime
</span><a href="Data.Time.Clock.Internal.AbsoluteTime.html#addAbsoluteTime"><span class="hs-identifier hs-var">addAbsoluteTime</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; DiffTime
forall a b. (Real a, Fractional b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#realToFrac"><span class="hs-identifier hs-var">realToFrac</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; DiffTime) -&gt; Integer -&gt; DiffTime
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Day -&gt; Integer
</span><a href="Data.Time.Calendar.Days.html#toModifiedJulianDay"><span class="hs-identifier hs-var hs-var">toModifiedJulianDay</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074736"><span class="hs-identifier hs-var">day</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">86400</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679074735"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="Data.Time.Clock.Internal.AbsoluteTime.html#taiEpoch"><span class="hs-identifier hs-var">taiEpoch</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="annot"><a href="Data.Time.Clock.TAI.html#utcToTAITime"><span class="hs-identifier hs-type">utcToTAITime</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Clock.TAI.html#LeapSecondMap"><span class="hs-identifier hs-type">LeapSecondMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier hs-type">UTCTime</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.AbsoluteTime.html#AbsoluteTime"><span class="hs-identifier hs-type">AbsoluteTime</span></a></span><span>
</span><span id="line-46"></span><span id="utcToTAITime"><span class="annot"><span class="annottext">utcToTAITime :: LeapSecondMap -&gt; UTCTime -&gt; Maybe AbsoluteTime
</span><a href="Data.Time.Clock.TAI.html#utcToTAITime"><span class="hs-identifier hs-var hs-var">utcToTAITime</span></a></span></span><span> </span><span id="local-6989586621679074730"><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074730"><span class="hs-identifier hs-var">lsmap</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier hs-type">UTCTime</span></a></span><span> </span><span id="local-6989586621679074728"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074728"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span id="local-6989586621679074727"><span class="annot"><span class="annottext">DiffTime
</span><a href="#local-6989586621679074727"><span class="hs-identifier hs-var">dtime</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-47"></span><span>    </span><span id="local-6989586621679074726"><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074726"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LeapSecondMap -&gt; Day -&gt; Maybe AbsoluteTime
</span><a href="Data.Time.Clock.TAI.html#dayStart"><span class="hs-identifier hs-var">dayStart</span></a></span><span> </span><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074730"><span class="hs-identifier hs-var">lsmap</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074728"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-48"></span><span>    </span><span class="annot"><span class="annottext">AbsoluteTime -&gt; Maybe AbsoluteTime
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(AbsoluteTime -&gt; Maybe AbsoluteTime)
-&gt; AbsoluteTime -&gt; Maybe AbsoluteTime
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DiffTime -&gt; AbsoluteTime -&gt; AbsoluteTime
</span><a href="Data.Time.Clock.Internal.AbsoluteTime.html#addAbsoluteTime"><span class="hs-identifier hs-var">addAbsoluteTime</span></a></span><span> </span><span class="annot"><span class="annottext">DiffTime
</span><a href="#local-6989586621679074727"><span class="hs-identifier hs-var">dtime</span></a></span><span> </span><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074726"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="annot"><a href="Data.Time.Clock.TAI.html#taiToUTCTime"><span class="hs-identifier hs-type">taiToUTCTime</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Clock.TAI.html#LeapSecondMap"><span class="hs-identifier hs-type">LeapSecondMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.AbsoluteTime.html#AbsoluteTime"><span class="hs-identifier hs-type">AbsoluteTime</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier hs-type">UTCTime</span></a></span><span>
</span><span id="line-51"></span><span id="taiToUTCTime"><span class="annot"><span class="annottext">taiToUTCTime :: LeapSecondMap -&gt; AbsoluteTime -&gt; Maybe UTCTime
</span><a href="Data.Time.Clock.TAI.html#taiToUTCTime"><span class="hs-identifier hs-var hs-var">taiToUTCTime</span></a></span></span><span> </span><span id="local-6989586621679074725"><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074725"><span class="hs-identifier hs-var">lsmap</span></a></span></span><span> </span><span id="local-6989586621679074724"><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074724"><span class="hs-identifier hs-var">abstime</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-52"></span><span>    </span><span id="local-6989586621679074718"><span class="annot"><span class="annottext">stable :: Day -&gt; Maybe UTCTime
</span><a href="#local-6989586621679074718"><span class="hs-identifier hs-var hs-var">stable</span></a></span></span><span> </span><span id="local-6989586621679074717"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074717"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-53"></span><span>        </span><span id="local-6989586621679074716"><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074716"><span class="hs-identifier hs-var">dayt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LeapSecondMap -&gt; Day -&gt; Maybe AbsoluteTime
</span><a href="Data.Time.Clock.TAI.html#dayStart"><span class="hs-identifier hs-var">dayStart</span></a></span><span> </span><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074725"><span class="hs-identifier hs-var">lsmap</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074717"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-54"></span><span>        </span><span id="local-6989586621679074715"><span class="annot"><span class="annottext">DiffTime
</span><a href="#local-6989586621679074715"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LeapSecondMap -&gt; Day -&gt; Maybe DiffTime
</span><a href="Data.Time.Clock.TAI.html#utcDayLength"><span class="hs-identifier hs-var">utcDayLength</span></a></span><span> </span><span class="annot"><span class="annottext">LeapSecondMap
</span><a href="#local-6989586621679074725"><span class="hs-identifier hs-var">lsmap</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074717"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-55"></span><span>        </span><span class="hs-keyword">let</span><span>
</span><span id="line-56"></span><span>            </span><span id="local-6989586621679074714"><span class="annot"><span class="annottext">dtime :: DiffTime
</span><a href="#local-6989586621679074714"><span class="hs-identifier hs-var hs-var">dtime</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AbsoluteTime -&gt; AbsoluteTime -&gt; DiffTime
</span><a href="Data.Time.Clock.Internal.AbsoluteTime.html#diffAbsoluteTime"><span class="hs-identifier hs-var">diffAbsoluteTime</span></a></span><span> </span><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074724"><span class="hs-identifier hs-var">abstime</span></a></span><span> </span><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074716"><span class="hs-identifier hs-var">dayt</span></a></span><span>
</span><span id="line-57"></span><span>            </span><span id="local-6989586621679074710"><span class="annot"><span class="annottext">day' :: Day
</span><a href="#local-6989586621679074710"><span class="hs-identifier hs-var hs-var">day'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#addDays"><span class="hs-identifier hs-var">addDays</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DiffTime -&gt; DiffTime -&gt; Integer
forall a b. (Real a, Integral b) =&gt; a -&gt; a -&gt; b
</span><a href="../../base/src/Data.Fixed.html#div%27"><span class="hs-identifier hs-var">div'</span></a></span><span> </span><span class="annot"><span class="annottext">DiffTime
</span><a href="#local-6989586621679074714"><span class="hs-identifier hs-var">dtime</span></a></span><span> </span><span class="annot"><span class="annottext">DiffTime
</span><a href="#local-6989586621679074715"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074717"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-58"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074717"><span class="hs-identifier hs-var">day</span></a></span><span> </span><span class="annot"><span class="annottext">Day -&gt; Day -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074710"><span class="hs-identifier hs-var">day'</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">UTCTime -&gt; Maybe UTCTime
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Day -&gt; DiffTime -&gt; UTCTime
</span><a href="Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier hs-var">UTCTime</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074717"><span class="hs-identifier hs-var">day</span></a></span><span> </span><span class="annot"><span class="annottext">DiffTime
</span><a href="#local-6989586621679074714"><span class="hs-identifier hs-var">dtime</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Day -&gt; Maybe UTCTime
</span><a href="#local-6989586621679074718"><span class="hs-identifier hs-var">stable</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679074710"><span class="hs-identifier hs-var">day'</span></a></span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Day -&gt; Maybe UTCTime
</span><a href="#local-6989586621679074718"><span class="hs-identifier hs-var">stable</span></a></span><span> </span><span class="annot"><span class="annottext">(Day -&gt; Maybe UTCTime) -&gt; Day -&gt; Maybe UTCTime
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#ModifiedJulianDay"><span class="hs-identifier hs-var">ModifiedJulianDay</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Day) -&gt; Integer -&gt; Day
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DiffTime -&gt; DiffTime -&gt; Integer
forall a b. (Real a, Integral b) =&gt; a -&gt; a -&gt; b
</span><a href="../../base/src/Data.Fixed.html#div%27"><span class="hs-identifier hs-var">div'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AbsoluteTime -&gt; AbsoluteTime -&gt; DiffTime
</span><a href="Data.Time.Clock.Internal.AbsoluteTime.html#diffAbsoluteTime"><span class="hs-identifier hs-var">diffAbsoluteTime</span></a></span><span> </span><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="#local-6989586621679074724"><span class="hs-identifier hs-var">abstime</span></a></span><span> </span><span class="annot"><span class="annottext">AbsoluteTime
</span><a href="Data.Time.Clock.Internal.AbsoluteTime.html#taiEpoch"><span class="hs-identifier hs-var">taiEpoch</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">DiffTime
</span><span class="hs-number">86400</span></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-comment">-- | TAI clock, if it exists. Note that it is unlikely to be set correctly, without due care and attention.</span><span>
</span><span id="line-62"></span><span class="annot"><a href="Data.Time.Clock.TAI.html#taiClock"><span class="hs-identifier hs-type">taiClock</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Time.Clock.Internal.DiffTime.html#DiffTime"><span class="hs-identifier hs-type">DiffTime</span></a></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="Data.Time.Clock.Internal.AbsoluteTime.html#AbsoluteTime"><span class="hs-identifier hs-type">AbsoluteTime</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span id="taiClock"><span class="annot"><span class="annottext">taiClock :: Maybe (DiffTime, IO AbsoluteTime)
</span><a href="Data.Time.Clock.TAI.html#taiClock"><span class="hs-identifier hs-var hs-var">taiClock</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((DiffTime, IO SystemTime) -&gt; (DiffTime, IO AbsoluteTime))
-&gt; Maybe (DiffTime, IO SystemTime)
-&gt; Maybe (DiffTime, IO AbsoluteTime)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(IO SystemTime -&gt; IO AbsoluteTime)
-&gt; (DiffTime, IO SystemTime) -&gt; (DiffTime, IO AbsoluteTime)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SystemTime -&gt; AbsoluteTime) -&gt; IO SystemTime -&gt; IO AbsoluteTime
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">SystemTime -&gt; AbsoluteTime
</span><a href="Data.Time.Clock.System.html#systemToTAITime"><span class="hs-identifier hs-var">systemToTAITime</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (DiffTime, IO SystemTime)
</span><a href="Data.Time.Clock.Internal.SystemTime.html#getTAISystemTime"><span class="hs-identifier hs-var">getTAISystemTime</span></a></span><span>
</span><span id="line-64"></span></pre></body></html>